/**
 * 
 */
package com.dsbridge.enrollment.jpadao;

import javax.persistence.EntityManagerFactory;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.orm.jpa.JpaTemplate;
import org.springframework.stereotype.Repository;

import com.dsbridge.enrollment.entities.Student;

/**
 * @author rithvik
 * 
 */
@Repository
public class StudentJPADAO {

	@Autowired
	private EntityManagerFactory emf;

	private JpaTemplate jpaTemplate;

	
	public int createStudent(Student student) {
		jpaTemplate = new JpaTemplate(emf);
		jpaTemplate.persist(student);
		return student.getStudentId();
	}

}
